table.insert(itemActions,
	function(item, action)
		-- MAGIC circlets
		-- see: dir .. "readme.txt" for information regarding these variables
		local priority = 5
		local identify = true
		local dump = true

		if not (item.quality == ItemQuality.Magic and item.baseItem.baseType.Type == ItemKind.Circlet) then 
			return false
		elseif action == aPICK and (not item.flags.Identified or isGoodMagicCirclet(item)) then
			return priority
		elseif action == aIDENT then
			return identify
		elseif action == aSELL and item.flags.Identified and not isGoodMagicCirclet(item) then
			return true
		elseif action == aDUMP and item.flags.Identified and not isGoodMagicCirclet(item) then
			return dump
		end

		return false
	end
)

function isGoodMagicCirclet(item)
	-- feel free to change the lower prefix/suffix bounds
	local prefix, suffix, affix = false, false, false


	for i = 0, item.mods:size() - 1 do
		if item.mods[i].Stat.Type == StatType.ClassSkillsBonus and
				item.mods[i].Value >= 2 then -- 2sk->prefix
			prefix = true
		elseif item.mods[i].Stat.Type == StatType.SkillTabBonus and
				item.mods[i].Value >= 2 then --  2-3sktab->prefix
			prefix = true
		elseif item.mods[i].Stat.Type == StatType.MaxMana and
				item.mods[i].Value >= 30 then --  51+mp->prefix
			prefix = true
		elseif item.mods[i].Stat.Type == StatType.FasterCastRate then
			affix = true -- any fcr->suffix
		elseif item.mods[i].Stat.Type == StatType.FasterMoveVelocity and
				item.mods[i].Value >= 10 then -- 20frw->suffix
			affix = true
		elseif (item.mods[i].Stat.Type == StatType.Strength or
				item.mods[i].Stat.Type == StatType.Dexterity or
				item.mods[i].Stat.Type == StatType.Energy) and
				item.mods[i].Value >= 10 then -- 15+str/dex/eng->suffix
			prefix = true
		elseif item.mods[i].Stat.Type == StatType.MaxLife and
				item.mods[i].Value >= 30 then -- 51+hp->suffix
			afffix = true
		elseif item.mods[i].Stat.Type == StatType.MagicFind and
				item.mods[i].Value >= 15 then -- 15+mf->suffix
			suffix = true
		elseif item.mods[i].Stat.Type == StatType.MagicFind and
				item.mods[i].Value >= 30 then -- 37+mf->affix (for mf circs)
			affix = true
		elseif hasCertainSockets(item, "23") then -- 2-3os
			sox = true
	end

end
	
	-- Add Elephant suffix if I ever get around to it

	return (
		    prefix or
			suffix or
			affix or 
			sox 
		   )
end

--StatType.MagicFind
---Fortuitous 11-15%  prefix
---Luck 26-35% suffix
